export class Storage {
  constructor() {}
  static getLoc(key) {
    return JSON.parse(localStorage.getItem(key))
  }
  static setLoc(obj) {
    localStorage.setItem(obj.key, JSON.stringify(obj.value))
  }
  static removeLoc(key) {
    localStorage.removeItem(key)
  }
  static getSession(key) {
    return sessionStorage.getItem(key) && sessionStorage.getItem(key) !== 'undefined'
      ? JSON.parse(sessionStorage.getItem(key))
      : ''
  }
  static setSession(obj) {
    sessionStorage.setItem(obj.key, JSON.stringify(obj.value))
  }
  static removeSession(key) {
    sessionStorage.removeItem(key)
  }
}
